<template>
  <el-card class="box-card">
    <el-row type="flex" justify="space-between" align="middle">
      <el-col>
        <div v-if="showBefore" class="before">
          <i class="el-icon-info" />
          <slot name="before" />
        </div>
      </el-col>
      <el-col>
        <el-row type="flex" justify="end">
          <!-- 后插槽 -->
          <slot name="after" />
        </el-row>
      </el-col>
    </el-row>
  </el-card>
</template>

<script>
export default {
  props: {
    showBefore: {
      default: false,
      type: Boolean
    }
  }
}
</script>

<style scoped>
.box-card {
  height: 76px;
  margin-bottom: 20px;
}

.before {
  padding: 0 10px;
  background-color: #e6f7ff;
  line-height: 34px;
  display: inline-block;
  border: 1px solid #e6f7ff;
  border-radius: 3px;
}

.el-icon-info {
  color: #409eff;
  margin-right: 5px;
}
</style>
